﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Gakita.View.Menu
{
    /* This class contains information about the Select Level Menu */
    class SelectLevelModel : MenuModel
    {
        public SelectLevelModel()
        {
            _selectedMenuOption = (MenuModel.MenuOptions)10;
            _menuOptions = new MenuModel.MenuOptions[5] { MenuModel.MenuOptions.FirstLevel, MenuModel.MenuOptions.SecondLevel,                                                                         MenuModel.MenuOptions.ThirdLevel, MenuModel.MenuOptions.FourthLevel,                                                                         MenuModel.MenuOptions.ExitGame };
            _maxMenuOption = 13;
            _minMenuOption = 10;
        }

        public override void SelectPreviousMenuOption()
        {
            if ((int)_selectedMenuOption == _minMenuOption)
            {
                _selectedMenuOption = MenuOptions.ExitGame;
            }
            else if (_selectedMenuOption == MenuOptions.ExitGame)
            {
                _selectedMenuOption = (MenuModel.MenuOptions)_maxMenuOption;
            }
            else
            {
                _selectedMenuOption = _selectedMenuOption - 1;
            }
        }

        public override void SelectNextMenuOption()
        {
            if ((int)_selectedMenuOption == _maxMenuOption)
            {
                _selectedMenuOption = MenuOptions.ExitGame;
            }
            else if (_selectedMenuOption == MenuOptions.ExitGame)
            {
                _selectedMenuOption = (MenuModel.MenuOptions)_minMenuOption;
            }
            else
            {
                _selectedMenuOption = _selectedMenuOption + 1;
            }
        }
    }
}
